<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>v-show</title>
	</head>
	<body >
		<div id="app">
			<input type="button" @click="changeIsShow" value="显示或隐藏"/>
			<input type="button" @click="addAge" value="增加年龄" />
			<img src="img/bg1.jpg" v-if="isShow"/>
			<img src="img/bg2.jpg" v-if="age>17"/>
		</div>
		<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
		<script>
			var app=new Vue({
				el:"#app",
				data:{
					isShow:true,
					age:15
				},
				methods:{
					changeIsShow:function(){
						this.isShow=!this.isShow
					},
					addAge:function(){
						this.age++
						alert(this.age)
					}
				}
			})
		</script>
	</body>
</html>
